#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#define HLDataType char
#define NUM 5

typedef struct HashList
{
	int num;
	HLDataType* data;
}HashList;
HashList* InitList()
{
	HashList* list = (HashList*)malloc(sizeof(HashList));
	list->num = 0;
	list->data = (HLDataType*)malloc(sizeof(HLDataType)*NUM);
	for (int i = 0; i < NUM; i++)
	{
		list->data[i] = 0;
	}
	return list;
}
int Hash(int data)
{
	return data % NUM;
}
void PutData(HashList* list, HLDataType data)
{
	int index = Hash(data);
	if (list->data[index] != 0)
	{
		int count = 1;
		while (list->data[index] != 0)
		{
			index = Hash(Hash(data) + count);
			count++;
		}
	}
	list->data[index] = data;
	list->num++;
}
int main()
{
	HashList* list = InitList();
	PutData(list, 'a');
	PutData(list, 'e');
	printf("%c\n", list->data[0]);
	printf("%c\n", list->data[1]);
	return 0;
}